Skip to content

Conversation

@Sicheng-Pan
Copy link
Contributor

@Sicheng-Pan Sicheng-Pan commented Feb 10, 2026

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Updated spann provider to spawn quantized writer with feature flag
    • Wire up the quantized writer spawning in compactor
  • New functionality
    • N/A

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?

Observability plan

What is the plan to instrument and monitor this change?

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

Copy link
Contributor Author

Sicheng-Pan commented Feb 10, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@blacksmith-sh

This comment has been minimized.

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from 15768fa to e3957b5 Compare February 11, 2026 02:22
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from 184f5c3 to ff1afdf Compare February 11, 2026 02:22
@Sicheng-Pan Sicheng-Pan marked this pull request as ready for review February 11, 2026 02:30
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Feb 11, 2026

Enable quantized SPANN writer throughout compaction and frontend

This PR wires the USearch-based quantized SPANN writer through the worker, compaction manager, frontend, and schema layers so that collections whose schema enables quantization can spawn and persist quantized SPANN segments. It introduces the Quantization enum (currently none or u_search4_bit_rabit_q), updates schema merge/reconcile logic, persists the USearch provider where needed, and exposes the configuration through the JS client.
Key orchestration paths (log fetch, attached function compaction, compaction manager, worker server) now conditionally invoke write_quantized_usearch when the vector segment type is QuantizedSpann, while schema defaults/backfills now call Schema::quantize based on tenant allow-lists.

Key Changes

• Update SpannProvider to manage both HNSW and USearch providers, expose write_quantized_usearch, and load/save quantized cluster metadata (rust/segment/src/spann_provider.rs).
• Propagate USearch provider initialization and quantized writer invocation through orchestration layers (attached_function_orchestrator.rs, log_fetch_orchestrator.rs, compact.rs, compaction_manager.rs, worker server).
• Extend schema model with Quantization enum, builder helpers, validation rules, tenant-based enablement, and regenerate JS client typings (rust/types/src/collection_schema.rs, clients/new-js/types.gen.ts).
• Enhance quantized SPANN index implementation/tests to honor new quantization config defaults (rust/index/src/spann/quantized_spann.rs).
• Enable schema.quantize(Quantization::USearch4BitRabitQ) per configured tenants in the service-based frontend and ensure downstream requests respect quantized segment types.

Possible Issues

• Schema quantization defaults automatically set numerous SPANN parameters; existing collections may see unexpected overrides if tenant allow-list matches more broadly than intended.
• USearch provider caching now depends on hnsw_cache_config; misconfiguration could evict HNSW entries or under-provision quantized indices.

This summary was automatically generated by @propel-code-bot

@blacksmith-sh

This comment has been minimized.

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from e3957b5 to 0a585d2 Compare February 11, 2026 19:10
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from ff1afdf to d599ae5 Compare February 11, 2026 19:10
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from 3324688 to f823d3d Compare February 11, 2026 21:07
@blacksmith-sh

This comment has been minimized.

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from f823d3d to d45735e Compare February 12, 2026 01:40
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from 22ff37f to fa35f48 Compare February 12, 2026 01:40
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from d45735e to d24f142 Compare February 12, 2026 01:41
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from fa35f48 to b02eb80 Compare February 12, 2026 01:41
Comment on lines +514 to +516
let usearch_cache =
chroma_cache::from_config(&config.hnsw_provider.hnsw_cache_config).await?;
let usearch_provider = USearchIndexProvider::new(storage.clone(), usearch_cache);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

[Performance] This creates a new, separate cache instance using the same configuration as the HNSW provider. If hnsw_cache_config specifies a memory limit (e.g., 1GB), creating a second cache here effectively doubles the potential memory usage (to 2GB).

Consider sharing the cache instance between providers if they are compatible, or explicitely configuring a separate cache for USearch to avoid implicit resource doubling.

Context for Agents
This creates a new, separate cache instance using the same configuration as the HNSW provider. If `hnsw_cache_config` specifies a memory limit (e.g., 1GB), creating a second cache here effectively doubles the potential memory usage (to 2GB). 

Consider sharing the cache instance between providers if they are compatible, or explicitely configuring a separate cache for USearch to avoid implicit resource doubling.

File: rust/worker/src/compactor/compaction_manager.rs
Line: 516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant